package com.knowif.search;

/**
 * @author ：Xh
 * @date ：Created in 2019/5/3 0003 14:11
 */
public class Condition {

    /**
     * 查询字段编码（数据库字段）
     */
    private String code;

    /**
     * 查询字段值类型
     */
    private String type;

    /**
     * 查询方式：1、等于 2、大于 3、 大于等于 4、小于  5、小于等于  6、不等于 7 like  8、not like  9.in  10 not in
     */
    private int operator;

    /**
     * 查询条件值
     */
    private Object value;

    public Condition() {
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getOperator() {
        return this.operator;
    }

    public void setOperator(int operator) {
        this.operator = operator;
    }

    @SuppressWarnings("unchecked")
    public <T> T getValue() {
        return (T) this.value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

	@Override
	public String toString() {
		return "Condition [code=" + code + ", type=" + type + ", operator=" + operator + ", value=" + value + "]";
	}
    
    
}

